fetcher: Add a queue to limit requests sent to soup
authorSjoerd Simons <sjoerd@luon.net>
Sun, 15 Sep 2013 19:25:02 +0000 (21:25 +0200)
committerSjoerd Simons <sjoerd@luon.net>
Sun, 22 Sep 2013 21:40:51 +0000 (23:40 +0200)
commit5f310868f778d3691fcd269718258a8680394a01
treee3955ed738abefb6c18d3ed8fde8a40fa8549624
parentc044cdfb7d11225a120228046ced416ddcaeb4a2
fetcher: Add a queue to limit requests sent to soup

On a large ostree repository pulling over http slows to a crawl. Pulling
from localhost results in:
 5944 metadata, 63734 content objects fetched; 850509 KiB transferred in
 1106 seconds
In other words about 800KiB/s. Some profiling shows that essentially
all of the CPU goes into libsoup doing its request bookkeeping instead
of into the actual downloading.

Adding a simple queue to limit to number of active request sent into
libsoup makes for a dramatic improvement:
 5944 metadata, 63734 content objects fetched; 850509 KiB transferred
 in 89 seconds
So around 9450 KiB/s.

https://bugzilla.gnome.org/show_bug.cgi?id=708126
src/libostree/ostree-fetcher.c